<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'curtomerResouce.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="<%=path%>/js/swfobject.js"></script>
	

  </head>
  
  <body>
    <table width="100%" height="100%">
    	<tr height="10%"><td>
    		<table>
    			<tr>
    				<td>
    					公司：
    					<select name="company" id="company"  onchange="conditionChange();">
    						<option value="">选择公司</option>
    						<option value="移动" selected>移动</option>
    						<option value="电信">电信</option>
    						<option value="联通">联通</option>
    						<option value="所有">所有</option>
    					</select>
    				</td>
    				<td>
    					
    					<select name="colName" id="colName" onchange="conditionChange();">
    						<option value="">选择比较内容</option>
    						
    						<option value="service_num">服营厅</option>
    						<option value="star_levelone">一星渠道</option>
    						<option value="star_leveltwo" selected>二星渠道</option>
    						<option value="star_levelthree">三星渠道</option>
    						<option value="star_levelfour">四星渠道</option>
    						<option value="star_levelfive">五星渠道</option>
    						<option value="star_levelsix">六星渠道</option>
    						<option value="net_village">农村网点</option>
    						<option value="net_gaojiazhi">高价值网点</option>
    						<option value="net_shuangpt">双排它专营点</option>
    						<option value="net_putong">普通点</option>
    						
    						
    					</select>
    				</td>
    			</tr>
    		</table>
    		
    	</td></tr>
    	<tr height="95%"><td id="chartplace"></td></tr>
    </table>
  </body>
</html>

<script type="text/javascript">
		// <![CDATA[
		var so = null;
		function conditionChange(){
			var company=getSelectValue(document.all.company);
			var colName=getSelectValue(document.all.colName);
			if(company && colName){
				initReport(company,colName);
			}
		}
		
		function initReport(company,colName){
		
			var url="<%=basePath%>reportAction.do?pars=channelResouce@"+company+"@"+colName;
			//var url="http://localhost:8899/sg_market/reportAction.do?pars=channelResouce@"+company+"@"+colName
			alert(url);
			so = new SWFObject("<%=path%>/flash/Chart.swf", null, "100%", "100%", "9", "#FF6600");
			so.addVariable("dataurl", url);
			so.addVariable("chartindex", 1);
			so.addParam("allowFullScreen", "true");
			so.write("chartplace");
			
		}
		function getSelectValue(obj){
		if(!obj.selectedIndex)obj=document.getElementById(obj);
		if(obj){
			var index=obj.selectedIndex;
			var val=obj.options[index].value;
			return val;	
		}
		return;
}
conditionChange();
		// ]]>
	</script>
